<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>房产中介管理系统</title>
<script type="text/javascript">
Ext.onReady(function(){

	var onValid = function ()
	{
		if (district2.isValid() && district2.getRawValue() != '全部'
			&& district3.isValid()
			&& doorplate.isValid()
			&& house_fang.isValid()
			&& build_size.isValid()
			&& ((rent_unit_price.isValid() && type.getValue()=='出租') || (sale_price.isValid() && type.getValue()=='出售') || (rent_unit_price.isValid() && sale_price.isValid() && type.getValue()=='租售'))
			&& HOUSE_OWNER.isValid()
			&& HOUSE_OWNER_tel.isValid()
			&& contract_date.isValid())
		{
			SaveButton.enable();
		}
		else
		{
			SaveButton.disable();
		}
	}
	var onInvalid = function ()
	{
		if (district2.getRawValue() != '全部'
			&& district3.getRawValue() != ''
			&& doorplate.getValue() != ''
			&& house_fang.getValue() != ''
			&& build_size.getValue() != ''
			&& ((rent_unit_price.getValue() != '' && type.getValue()=='出租') || (sale_price.getValue() != '' && type.getValue()=='出售') || (rent_unit_price.getValue() != '' && sale_price.getValue() != '' && type.getValue()=='租售'))
			&& HOUSE_OWNER.getValue() != ''
			&& HOUSE_OWNER_tel.getValue() != ''
			&& Date.parseDate(contract_date.getValue(), 'Y-m-d') != null)
		{
			SaveButton.enable();
		}
		else
		{
			SaveButton.disable();
		}
		//alert(obj.getValue());
		//alert(district3.validate());
	}

	new Ext.form.Form('DialogForm');

	Ext.form.Field.prototype.msgTarget = 'qtip';

    var district1 = new Ext.form.ComboBox({
        transform:'district1',
        width:70,
        listWidth:90,
        editable:false
    });
    district1.on('select',function(){
    		district2.clearValue();
    		district2_store.proxy.getConnection().url='<?=site_url()?>/house/manager/getdistrict/'+district1.getValue();
    		district2_store.load();

    		district3.clearValue();
    		district3_store.proxy.getConnection().url='<?=site_url()?>/house/manager/getAllDistrict/'+district1.getValue();
    		district3_store.load();

    		onInvalid();
    	}
    );

	var district2_store = new Ext.data.Store({
		proxy: new Ext.data.HttpProxy({url: '<?=site_url()?>/house/manager/getdistrict/'+district1.getValue(), method: 'get'}),
        reader: new Ext.data.XmlReader({record: 'Item'}, ['ID','NAME'])
	});
	var district2 = new Ext.form.ComboBox({
		store: district2_store,
		displayField: 'NAME',
		valueField: 'ID',
		mode: 'local',
		triggerAction: 'all',
        width:95,
        listWidth:115,
        allowBlank:false,
        blankText:'片区不能为空！',
        editable:false
	}).applyTo('district2');
	district2_store.on("load",function(obj){obj.insert(0,new Ext.data.Record({ID:'',NAME:'全部'}));/*district2.setValue('全部');*/});
	//district2.store.proxy.getConnection().url='<?=site_url()?>/house/manager/getdistrict/235';
	//alert(store.proxy.getConnection().url);
    district2.on('invalid',onInvalid);
    district2.on('valid',onValid);
    district2.on('select',function(){
    		district3.clearValue();
    		if (district2.getValue()=='')
    		{
	   			district3_store.proxy.getConnection().url = '<?=site_url()?>/house/manager/getalldistrict/' + district1.getValue();
    		}
    		else
    		{
	   			district3_store.proxy.getConnection().url = '<?=site_url()?>/house/manager/getdistrict/' + district2.getValue();
    		}
    		district3_store.load();

    		onInvalid();
    	}
    );

	var district3_store = new Ext.data.Store({
		proxy: new Ext.data.HttpProxy({url: '<?=site_url()?>/house/manager/getalldistrict/'+district1.getValue(), method: 'get'}),
        reader: new Ext.data.XmlReader({record: 'Item'}, ['ID','NAME'])
	});
	//district3_store.on('load',function(){alert((xmlreader.xmlData.xml));});
	var district3 = new Ext.form.ComboBox({
		store: district3_store,
		displayField: 'NAME',
		valueField: 'ID',
		mode: 'remote',
		triggerAction: 'all',
        width:95,
        listWidth:115,
        allowBlank:false,
        blankText:'楼盘字典不能为空！',
        loadingText:'装载中...',
        editable:true
	}).applyTo('district3');
	//district3_store.load();
    district3.on('invalid',onInvalid);
    district3.on('valid',onValid);


    var location = new Ext.form.TextField({
        width:60
    }).applyTo('location');
    var doorplate = new Ext.form.TextField({
        allowBlank:false,
        blankText:'房号不能为空！',
        width:50
    }).applyTo('doorplate');
    doorplate.on('invalid',onInvalid);
    doorplate.on('valid',onValid);;

    var FLOOR = new Ext.form.NumberField({
        width:50
    }).applyTo('FLOOR');
    var TOP_FLOOR = new Ext.form.NumberField({
        width:50
    }).applyTo('TOP_FLOOR');
    var HOUSE_AGE = new Ext.form.NumberField({
        width:50
    }).applyTo('HOUSE_AGE');

	// 第二层
    var house_fang = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'户型不能为空！',
        width:20
    }).applyTo('house_fang');
    house_fang.on('invalid',onInvalid);
    house_fang.on('valid',onValid);
    
    var house_ting = new Ext.form.NumberField({
        width:20
    }).applyTo('house_ting');
    var house_wei = new Ext.form.NumberField({
        width:20
    }).applyTo('house_wei');
    var house_tai = new Ext.form.NumberField({
        width:20
    }).applyTo('house_tai');

    var build_size = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'面积不能为空！',
        width:70
    }).applyTo('build_size');
	build_size.on('invalid',onInvalid);
	build_size.on('valid',onValid);

    var use_size = new Ext.form.NumberField({
        width:70
    }).applyTo('use_size');
    var car_size = new Ext.form.NumberField({
        width:50
    }).applyTo('car_size');
    var garden_size = new Ext.form.NumberField({
        width:50
    }).applyTo('garden_size');

    var place_size = new Ext.form.NumberField({
        width:50
    }).applyTo('place_size');
    var hovel_size = new Ext.form.NumberField({
        width:50
    }).applyTo('hovel_size');
    var code = new Ext.form.TextField({
        //disabled:true,
        width:80
    }).applyTo('code');

    var PURPOSE = new Ext.form.ComboBox({
        transform:'PURPOSE',
        width:60,
        editable:false
    });
    var DIRECTION = new Ext.form.ComboBox({
        transform:'DIRECTION',
        width:73,
        editable:false
    });
    var if_elevator = new Ext.form.Checkbox({
		boxLabel:'电梯'
    }).applyTo('if_elevator');
    var if_attic = new Ext.form.Checkbox({
		boxLabel:'阁楼'
    }).applyTo('if_attic');


    // 第三层
	var status = new Ext.form.ComboBox({
        transform:'status',
        width:70,
        editable:false
    });
    var fitment = new Ext.form.ComboBox({
        transform:'fitment',
        width:70,
        editable:false
    });
    var jiaju = new Ext.form.ComboBox({
        transform:'jiaju',
        width:70,
        editable:false
    });
    var jiadian = new Ext.form.ComboBox({
        transform:'jiadian',
        width:70,
        editable:false
    });
    var SOURCE = new Ext.form.ComboBox({
        transform:'SOURCE',
        width:70,
        editable:false
    });
    var fuyong = new Ext.form.ComboBox({
        transform:'fuyong',
        width:70,
        editable:false
    });
    var property = new Ext.form.ComboBox({
        transform:'property',
        width:70,
        editable:false
    });
    var zhengjian = new Ext.form.ComboBox({
        transform:'zhengjian',
        width:70,
        editable:false
    });
    var if_KEY = new Ext.form.Checkbox({
		boxLabel:'锁匙'
    }).applyTo('if_KEY');
    if_KEY.on('check',function(obj, checked){
    		if (checked)
    		{
    			publickey_num.enable();
    			privatekey_num.enable();
    			key_num.enable();
    		}
    		else
    		{
    			publickey_num.disable();
    			privatekey_num.disable();
    			key_num.disable();
    		}
    	}
    );
    var publickey_num = new Ext.form.Radio({
		boxLabel:'公钥',
		disabled:true
    }).applyTo('publickey_num');
    var privatekey_num = new Ext.form.Radio({
		boxLabel:'私钥',
		disabled:true
    }).applyTo('privatekey_num');
    var key_num = new Ext.form.NumberField({
        width:50,
		disabled:true
    }).applyTo('key_num');

	var kit_info = new Ext.form.TriggerField({
		width:70,
		onTriggerClick:function(e,obj){ShowMenu(Menu_kit_info, e, obj);}
	}).applyTo('kit_info');
	var kit_memo = new Ext.form.TriggerField({
		width:70,
		onTriggerClick:function(e,obj){ShowMenu(Menu_kit_memo, e, obj);}
	}).applyTo('kit_memo');

	kit_info.getEl().addListener('click', function(e,obj){ShowMenu(Menu_kit_info, e, obj);});
	kit_memo.getEl().addListener('click', function(e,obj){ShowMenu(Menu_kit_memo, e, obj);});
	// 单击组合框显示复选菜单
	var ShowMenu = function(Menu, e, obj)
	{
		var body = Ext.get(Ext.DomQuery.selectNode('body'));
		var combo = Ext.get(obj);
		var offsetHeight = body.getHeight() - combo.getTop() - Menu.getEl().getHeight();
		var offsetWidth = body.getWidth() - combo.getLeft() - Menu.getEl().getWidth();

		if (offsetHeight>0)
		{
			Menu.showAt(combo.getAlignToXY(obj));
		}
		else
		{
			if (offsetWidth>0) offsetWidth=0;
			Menu.showAt(combo.getAlignToXY(obj,'tl',[offsetWidth,offsetHeight]));
		}
	}


    // 配置
	var Menu_kit_info = new Ext.menu.Menu();	
	var Menus_kit_info = Ext.get('menu_kit_info').query('div');
	Ext.each(Menus_kit_info, function(obj) {
		Menu_kit_info.add(new Ext.menu.CheckItem({
				text:(obj.innerText?obj.innerText:obj.textContent),
				checked:(obj.getAttribute('checked')=='checked'),
				checkHandler:Handler_kit_info
			})
		);
	});
	function Handler_kit_info()
	{
		var info='';
		Ext.each(Menu_kit_info.getEl().query('.x-menu-list-item'), function(obj){
			if (Ext.get(obj).hasClass('x-menu-item-checked'))
				info += '-'+(obj.innerText?obj.innerText:obj.textContent)+'-';
		});
		kit_info.setValue(info);
		kit_info.getEl().dom.qtip=info;
	}

    // 配置备注
	var Menu_kit_memo = new Ext.menu.Menu();	
	var Menus_kit_memo = Ext.get('menu_kit_memo').query('div');
	Ext.each(Menus_kit_memo, function(obj) {
		Menu_kit_memo.add(new Ext.menu.CheckItem({
				text:(obj.innerText?obj.innerText:obj.textContent),
				checked:(obj.getAttribute('checked')=='checked'),
				checkHandler:Handler_kit_memo
			})
		);
	});
	function Handler_kit_memo()
	{
		var info='';
		Ext.each(Menu_kit_memo.getEl().query('.x-menu-list-item'), function(obj){
			if (Ext.get(obj).hasClass('x-menu-item-checked'))
				info += '-'+(obj.innerText?obj.innerText:obj.textContent)+'-';
		});
		kit_memo.setValue(info);
		kit_memo.getEl().dom.qtip=info;
	}


	// 第四层
	var type = new Ext.form.ComboBox({
        transform:'type',
        width:70,
        editable:false
    });
    type.on('select',function(e){
    		//onInvalid();
    		switch (e.getValue())
    		{
    			case '出租':
	    			sale_unit.disable();
	    			sale_price.disable();
	    			sale_price.clearInvalid();
	    			sale_base_price.disable();
	    			sale_unit_price.disable();

    				rent_unit_price.enable();
    				rent_unit.enable();
    				rent_base_price.enable();
    				rent_deposit.enable();
    				zhuanrang_price.enable();

    				break;
    			case '出售':
	    			sale_unit.enable();
	    			sale_price.enable();
	    			sale_base_price.enable();
	    			sale_unit_price.enable();

    				rent_unit_price.disable();
	    			rent_unit_price.clearInvalid();
    				rent_unit.disable();
    				rent_base_price.disable();
    				rent_deposit.disable();
    				zhuanrang_price.disable();

    				break;
    			default:
	    			sale_unit.enable();
	    			sale_price.enable();
	    			sale_base_price.enable();
	    			sale_unit_price.enable();

    				rent_unit_price.enable();
    				rent_unit.enable();
    				rent_base_price.enable();
    				rent_deposit.enable();
    				zhuanrang_price.enable();
    		}
    		onValid();
    	}
    );
	var rent_unit = new Ext.form.ComboBox({
        transform:'rent_unit',
        width:40,
        editable:false
    });
	var pay_type = new Ext.form.ComboBox({
        transform:'pay_type',
        width:70,
        editable:false
    });
	var money_type = new Ext.form.ComboBox({
        transform:'money_type',
        width:70,
        editable:false
    });
	var sale_unit = new Ext.form.ComboBox({
        transform:'sale_unit',
        width:70,
		disabled:true,
        editable:false
    });
	var manager_unit = new Ext.form.ComboBox({
        transform:'manager_unit',
        width:50,
        editable:false
    });

    var rent_unit_price = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'租价不能为空！',
        width:70
    }).applyTo('rent_unit_price');
    rent_unit_price.on('invalid',onInvalid);
    rent_unit_price.on('valid',onValid);

    var sale_price = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'售价不能为空！',
        disabled:true,
        width:70
    }).applyTo('sale_price');
    sale_price.on('invalid',onInvalid);
    sale_price.on('valid',onValid);

    var rent_base_price = new Ext.form.NumberField({
        width:70
    }).applyTo('rent_base_price');

    var sale_base_price = new Ext.form.NumberField({
        width:70,
        disabled:true
    }).applyTo('sale_base_price');

    var rent_deposit = new Ext.form.NumberField({
        width:70
    }).applyTo('rent_deposit');

    var sale_unit_price = new Ext.form.NumberField({
        width:70,
        disabled:true
    }).applyTo('sale_unit_price');

    var manager_fee = new Ext.form.NumberField({
        width:70
    }).applyTo('manager_fee');
    var zhuanrang_price = new Ext.form.NumberField({
        width:70
    }).applyTo('zhuanrang_price')


	// 第五层
    var HOUSE_OWNER = new Ext.form.TextField({
        allowBlank:false,
        blankText:'业主不能为空！',
        width:180
    }).applyTo('HOUSE_OWNER');
    HOUSE_OWNER.on('invalid',onInvalid);
    HOUSE_OWNER.on('valid',onValid);

    var HOUSE_OWNER_tel = new Ext.form.TextField({
        allowBlank:false,
        blankText:'业主电话不能为空！',
        width:180
    }).applyTo('HOUSE_OWNER_tel');
    HOUSE_OWNER_tel.on('invalid',onInvalid);
    HOUSE_OWNER_tel.on('valid',onValid);

    var linkman = new Ext.form.TextField({
        width:180
    }).applyTo('linkman');
    var linkman_tel = new Ext.form.TextField({
        width:180
    }).applyTo('linkman_tel');
    var HOUSE_OWNER_memo = new Ext.form.TextArea({
        width:417,
        height:50
    }).applyTo('HOUSE_OWNER_memo');
    var contract_date = new Ext.form.DateField({
        width:120,
        allowBlank:false,
        blankText:'委托日期不能为空！',
        invalidText:'日期格式错误！正确日期格式为: 四位年-月-日',
        format:'Y-m-d'
    }).applyTo('contract_date');
    contract_date.on('invalid',onInvalid);
    contract_date.on('valid',onValid);

	var duty_userid = new Ext.form.ComboBox({
        transform:'duty_userid',
        width:120,
        editable:false
    });
	var CONSIGN_TYPE = new Ext.form.ComboBox({
        transform:'CONSIGN_TYPE',
        width:120,
        editable:false
    });
    var if_tuijian = new Ext.form.Checkbox({
		boxLabel:'推介房源'
    }).applyTo('if_tuijian');
    var if_encrypt_owner = new Ext.form.Checkbox({
		boxLabel:'业主保密'
    }).applyTo('if_encrypt_owner');
    var if_encrypt_buildsrc = new Ext.form.Checkbox({
		boxLabel:'房源保密'
    }).applyTo('if_encrypt_buildsrc');
    var if_encrypt_dept = new Ext.form.Checkbox({
		boxLabel:'跨店保密'
    }).applyTo('if_encrypt_dept');


<?php
// 如果是编辑状态，则初始化所有控件值！
if ($mode=='edit')
{
	$editdata->contract_date = explode(' ', $editdata->contract_date);
	$editdata->contract_date = $editdata->contract_date[0];
?>

	// 第一层
	district1.setValue('<?=$editdata->district1id?>');
	district1.setRawValue('<?=$editdata->district1?>');
	district1.fireEvent('select', district1);
	district2.setValue('<?=$editdata->district2id?>');
	district2.setRawValue('<?=$editdata->district2?>');
	district3.setValue('<?=$editdata->FK_districtID?>');
	district3.setRawValue('<?=$editdata->district3?>');
    location.setValue('<?=$editdata->location?>');
    doorplate.setValue('<?=$editdata->doorplate?>');
    FLOOR.setValue('<?=$editdata->FLOOR?>');
    TOP_FLOOR.setValue('<?=$editdata->TOP_FLOOR?>');
    HOUSE_AGE.setValue('<?=$editdata->HOUSE_AGE?>');

    // 第二层
    house_fang.setValue('<?=$editdata->house_fang?>');
    house_ting.setValue('<?=$editdata->house_ting?>');
    house_wei.setValue('<?=$editdata->house_wei?>');
    house_tai.setValue('<?=$editdata->house_tai?>');
    build_size.setValue('<?=$editdata->build_size?>');
    use_size.setValue('<?=$editdata->use_size?>');
    car_size.setValue('<?=$editdata->car_size?>');
    garden_size.setValue('<?=$editdata->garden_size?>');
    place_size.setValue('<?=$editdata->place_size?>');
    hovel_size.setValue('<?=$editdata->hovel_size?>');
    code.setValue('<?=$editdata->id?>');
    PURPOSE.setValue('<?=$editdata->PURPOSE?>');
    DIRECTION.setValue('<?=$editdata->DIRECTION?>');
    if_elevator.setValue('<?=$editdata->if_elevator?>');
    if_attic.setValue('<?=$editdata->if_attic?>');

    // 第三层
	status.setValue('<?=$editdata->status?>');
    fitment.setValue('<?=$editdata->fitment?>');
    jiaju.setValue('<?=$editdata->jiaju?>');
    jiadian.setValue('<?=$editdata->jiadian?>');
    SOURCE.setValue('<?=$editdata->SOURCE?>');
    fuyong.setValue('<?=$editdata->fuyong?>');
    property.setValue('<?=$editdata->property?>');
    zhengjian.setValue('<?=$editdata->zhengjian?>');
    if_KEY.setValue('<?=$editdata->if_KEY?>');
    var num1 = <?=$editdata->publickey_num?>;
    var num2 = <?=$editdata->privatekey_num?>;
    if (num2>0)
    {
    	privatekey_num.setValue(true);
    	key_num.setValue(num2);
    }
    else
    {
    	publickey_num.setValue(true);
    	key_num.setValue(num1);
    }
	kit_info.setValue('<?=$editdata->kit_info?>');
	kit_memo.setValue('<?=$editdata->kit_memo?>');

	// 第四层
	type.setValue('<?=$editdata->type?>');
	type.fireEvent('select', type);
	rent_unit.setValue('<?=$editdata->rent_unit?>');
	pay_type.setValue('<?=$editdata->pay_type?>');
	money_type.setValue('<?=$editdata->money_type?>');
	sale_unit.setValue('<?=$editdata->sale_unit?>');
	manager_unit.setValue('<?=$editdata->manager_unit?>');
    rent_unit_price.setValue('<?=$editdata->rent_unit_price?>');
    sale_price.setValue('<?=$editdata->sale_price?>');
    rent_base_price.setValue('<?=$editdata->rent_base_price?>');
    sale_base_price.setValue('<?=$editdata->sale_base_price?>');
    rent_deposit.setValue('<?=$editdata->rent_deposit?>');
    sale_unit_price.setValue('<?=$editdata->sale_unit_price?>');
	manager_fee.setValue('<?=$editdata->manager_fee?>');
    zhuanrang_price.setValue('<?=$editdata->zhuanrang_price?>');

	// 第五层
    HOUSE_OWNER.setValue('<?=$editdata->HOUSE_OWNER?>');
    HOUSE_OWNER_tel.setValue('<?=$editdata->HOUSE_OWNER_tel?>');
    linkman.setValue('<?=$editdata->linkman?>');
    linkman_tel.setValue('<?=$editdata->linkman_tel?>');
    HOUSE_OWNER_memo.setValue('<?=$editdata->HOUSE_OWNER_memo?>');
    if (Date.parseDate('<?=$editdata->contract_date?>', 'Y-m-d')!=null)
    {
	    contract_date.setValue('<?=$editdata->contract_date?>');
    }
	duty_userid.setValue('<?=$editdata->duty_userid?>');
	CONSIGN_TYPE.setValue('<?=$editdata->CONSIGN_TYPE?>');
    if_tuijian.setValue('<?=$editdata->if_tuijian?>');
    if_encrypt_owner.setValue('<?=$editdata->if_encrypt_owner?>');
    if_encrypt_buildsrc.setValue('<?=$editdata->if_encrypt_buildsrc?>');
    if_encrypt_dept.setValue('<?=$editdata->if_encrypt_dept?>');

<?php
}
?>


	district2_store.load();


	// 删除“装载中...”，显示所有控件！
	Ext.get('load').remove();
	Ext.get('DialogForm').setVisible(true,{duration:.4});
});
</script>
</head>
<body>
<div id="body">
<div id="load" style="padding-left:23px;padding-top:4px;">装载中...</div>
<form id="DialogForm">
  <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="35">&nbsp;</td>
      <td>城区</td>
      <td class="noblank">片区</td>
      <td class="noblank">楼盘字典</td>
      <td>座栋/位置</td>
      <td class="noblank">房号</td>
      <td>楼层</td>
      <td>总层</td>
      <td>楼龄</td>
    </tr>
    <tr>
      <td height="25">地址:</td>
      <td width="100">
        <select name="district1" id="district1">
          <?php foreach($district1 as $item):?>
          <option value="<?=$item->ID;?>">
          <?=$item->NAME;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
      <td width="125">
        <input name="district2" id="district2" size="3" />
      </td>
      <td width="125">
        <input name="district3" type="text" id="district3" size="3" />
      </td>
      <td width="70">
        <input name="location" type="text" id="location" size="3" />
      </td>
      <td width="60">
        <input name="doorplate" type="text" id="doorplate" size="3" />
      </td>
      <td width="60">
        <input name="FLOOR" type="text" id="FLOOR" size="3" />
      </td>
      <td width="60">
        <input name="TOP_FLOOR" type="text" id="TOP_FLOOR" size="3" />
      </td>
      <td>
        <input name="HOUSE_AGE" type="text" id="HOUSE_AGE" size="3" />
      </td>
    </tr>
  </table>
  <hr />
  <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="35" height="25" class="noblank">户型:</td>
      <td colspan="3">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="30">
              <input name="house_fang" type="text" id="house_fang" size="3" />
            </td>
            <td>房</td>
            <td width="30">
              <input name="house_ting" type="text" id="house_ting" size="3" />
            </td>
            <td>厅</td>
            <td width="30">
              <input name="house_wei" type="text" id="house_wei" size="3" />
            </td>
            <td>卫</td>
            <td width="30">
              <input name="house_tai" type="text" id="house_tai" size="3" />
            </td>
            <td>阳台</td>
          </tr>
        </table>
      </td>
      <td width="35">车位:</td>
      <td width="80">
        <input name="car_size" type="text" id="car_size" size="3" /> ㎡</td>
      <td width="35">占地:</td>
      <td width="80">
        <input name="place_size" type="text" id="place_size" size="3" /> ㎡</td>
      <td width="35">用途:</td>
      <td width="93">
        <select name="PURPOSE" id="PURPOSE">
			<?php foreach($PURPOSE as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td width="35">编号:</td>
      <td width="91">
        <input name="code" type="text" id="code" size="3" readonly="readonly" />
      </td>
    </tr>
    <tr>
      <td height="25" class="noblank">面积:</td>
      <td width="100">
        <input name="build_size" type="text" id="build_size" size="3" /> ㎡</td>
      <td width="35">使用:</td>
      <td width="110">
        <input name="use_size" type="text" id="use_size" size="3" /> ㎡</td>
      <td>花园:</td>
      <td>
        <input name="garden_size" type="text" id="garden_size" size="3" /> ㎡</td>
      <td>杂间:</td>
      <td>
        <input name="hovel_size" type="text" id="hovel_size" size="3" /> ㎡</td>
      <td colspan="2">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
              <input name="if_elevator" type="checkbox" id="if_elevator" value="1" />
            </td>
            <td>
              <input type="checkbox" name="if_attic" id="if_attic" value="1" />
            </td>
          </tr>
        </table>
      </td>
      <td>朝向:</td>
      <td>
        <select name="DIRECTION" id="DIRECTION">
			<?php foreach($DIRECTION as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
    </tr>
  </table>
  <hr />
  <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="35" height="25">状态:</td>
      <td width="95">
        <select name="status" id="status">
			<?php foreach($status as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td width="35">装修:</td>
      <td width="95">
        <select name="fitment" id="fitment">
			<?php foreach($fitment as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td width="35">家俱:</td>
      <td width="95">
        <select name="jiaju" id="jiaju">
			<?php foreach($jiaju as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td width="35">家电:</td>
      <td width="100">
        <select name="jiadian" id="jiadian">
			<?php foreach($jiadian as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td width="35">配置:</td>
      <td width="90">
        <input name="kit_info" type="text" id="kit_info" size="3" readonly="readonly" />
      </td>
      <td width="35">备注:</td>
      <td>
        <input name="kit_memo" type="text" id="kit_memo" size="3" readonly="readonly" />
      </td>
    </tr>
    <tr>
      <td height="25">来源:</td>
      <td>
        <select name="SOURCE" id="SOURCE">
			<?php foreach($SOURCE as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td>付佣:</td>
      <td>
        <select name="fuyong" id="fuyong">
			<?php foreach($fuyong as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td>产权:</td>
      <td>
        <select name="property" id="property">
			<?php foreach($property as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td>证件:</td>
      <td>
        <select name="zhengjian" id="zhengjian">
			<?php foreach($zhengjian as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td colspan="4">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="24%">
              <input name="if_KEY" type="checkbox" id="if_KEY" value="1" />
            </td>
            <td width="23%">
              <input type="radio" name="key_type" id="publickey_num" checked="checked" value="0" />
            </td>
            <td width="23%">
              <input type="radio" name="key_type" id="privatekey_num" value="1" />
            </td>
            <td width="30%">
              <input name="key_num" type="text" id="key_num" size="3" />
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <hr />
  <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="35" height="25">租售:</td>
      <td width="108">
        <select name="type" id="type">
          <option value="出租">出租</option>
          <option value="出售">出售</option>
          <option value="租售">租售</option>
        </select>
      </td>
      <td width="70">&nbsp;</td>
      <td width="35">付款:</td>
      <td width="100">
        <select name="pay_type" id="pay_type">
			<?php foreach($pay_type as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td width="35">货币:</td>
      <td width="100">
        <select name="money_type" id="money_type">
			<?php foreach($money_type as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td width="45">管理费:</td>
      <td width="110">
        <input name="manager_fee" type="text" id="manager_fee" size="3" />
        元 / </td>
      <td>
        <select name="manager_unit" id="manager_unit">
			<?php foreach($unit as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
    </tr>
    <tr>
      <td height="25" class="noblank">租价:</td>
      <td>
        <input name="rent_unit_price" type="text" id="rent_unit_price" size="3" /> 元 /</td>
      <td>
        <select name="rent_unit" id="rent_unit">
			<?php foreach($unit as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td>底价:</td>
      <td>
        <input name="rent_base_price" type="text" id="rent_base_price" size="3" /> 万      </td>
      <td>押金:</td>
      <td>
        <input name="rent_deposit" type="text" id="rent_deposit" size="3" />
      </td>
      <td>转　让:</td>
      <td colspan="2">
        <input name="zhuanrang_price" type="text" id="zhuanrang_price" size="3" /> 万      </td>
    </tr>
    <tr>
      <td height="25" class="noblank">售价:</td>
      <td>
        <input name="sale_price" type="text" id="sale_price" size="3" /> 万      </td>
      <td>&nbsp;</td>
      <td>底价:</td>
      <td>
        <input name="sale_base_price" type="text" id="sale_base_price" size="3" /> 万      </td>
      <td>单价:</td>
      <td>
        <input name="sale_unit_price" type="text" id="sale_unit_price" size="3" /> 元      </td>
      <td align="center">/</td>
      <td colspan="2">
        <select name="sale_unit" id="sale_unit">
			<?php foreach($unit as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
    </tr>
  </table>
  <hr />
  <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="45" height="25" class="noblank">业　主:</td>
      <td width="200">
        <input name="HOUSE_OWNER" type="text" id="HOUSE_OWNER" size="3" />
      </td>
      <td width="35" class="noblank">电话:</td>
      <td width="200">
        <input name="HOUSE_OWNER_tel" type="text" id="HOUSE_OWNER_tel" size="3" />
      </td>
      <td width="45">委托日:</td>
      <td width="150">
        <input name="contract_date" type="text" id="contract_date" size="3" value="<?=date('Y-m-d')?>" />
      </td>
      <td>
        <input name="if_tuijian" type="checkbox" id="if_tuijian" value="1" />
      </td>
    </tr>
    <tr>
      <td height="25">联系人:</td>
      <td>
        <input name="linkman" type="text" id="linkman" size="3" />
      </td>
      <td>电话:</td>
      <td>
        <input name="linkman_tel" type="text" id="linkman_tel" size="3" />
      </td>
      <td>负责人:</td>
      <td>
        <select name="duty_userid" id="duty_userid">
          <option value="1">admin</option>
        </select>
      </td>
      <td>
        <input name="if_encrypt_owner" type="checkbox" id="if_encrypt_owner" value="1" />
      </td>
    </tr>
    <tr>
      <td height="25">备　注:</td>
      <td colspan="3" rowspan="2">
        <textarea name="HOUSE_OWNER_memo" id="HOUSE_OWNER_memo"></textarea>
      </td>
      <td>方　式:</td>
      <td>
        <select name="CONSIGN_TYPE" id="CONSIGN_TYPE">
			<?php foreach($CONSIGN_TYPE as $item):?>
            <option value="<?=$item->TreeView_Name;?>"><?=$item->TreeView_Name;?></option>
            <?php endforeach;?>
        </select>
      </td>
      <td>
        <input name="if_encrypt_buildsrc" type="checkbox" id="if_encrypt_buildsrc" value="1" />
      </td>
    </tr>
    <tr>
      <td height="25">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>
        <input name="if_encrypt_dept" type="checkbox" id="if_encrypt_dept" value="1" />
      </td>
    </tr>
  </table>
</form>
<div id="menu_kit_info" class="x-layer">
	<?php foreach($kit_info as $item):?>
	<?php if (strpos($editdata->kit_info, '-'.$item->TreeView_Name.'-')!==false): ?>
	<div checked="checked"><?=$item->TreeView_Name;?></div>
	<?php else:?>
	<div><?=$item->TreeView_Name;?></div>
	<?php endif;?>
    <?php endforeach;?>
</div>
<div id="menu_kit_memo" class="x-layer">
	<?php foreach($kit_memo as $item):?>
	<?php if (strpos($editdata->kit_memo, '-'.$item->TreeView_Name.'-')!==false): ?>
	<div checked="checked"><?=$item->TreeView_Name;?></div>
	<?php else:?>
	<div><?=$item->TreeView_Name;?></div>
	<?php endif;?>
    <?php endforeach;?>
</div>
</div>
</body>
</html>
